Skip to content

Learning: examples as a compact list with a detail panel - #246

Merged
nambok merged 1 commit into
mainfrom
ui/examples-compact
Oct 27, 2026
Merged

nambok merged 1 commit into
mainfrom
ui/examples-compact

Conversation

@nambok

@nambok nambok commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

"Examples in use" on the Learning page was turning into a wall: two tall columns of cards, each with the full excerpt, raw markup included (HTML comments, ##, **bold**, "Source ticket" lines, callouts, words cut in half). It now follows the issue-list pattern (Linear, GitHub, Sentry): a dense list of one-line rows, filters above, and the full item in a side panel beside the list. Server side (clean title, summary, reason, recent uses) is CoderHelm/coderhelm-platform#334; this works with or without it.

Changes

  • src/app/learning/examples.tsx (new), replacing the card columns in page.tsx:
    • Each row has a one-line title, the reason it is an example ("CI passed on the first try, merged without changes"), kind, category and path as tags, the repo with a PR link, and reward and use count as chips. The whole row opens the panel, and the PR link stays clickable. On a phone the chips move to the end of the tag line.
    • To follow / To avoid toggles show counts that follow the other filters. There is also search (press / to focus), a repository filter (only when there are 2 or more repos) and a kind filter, plus "Clear filters". Rows are sorted by most used, then by reward. The list shows 10, with "Show N more".
    • The panel uses the shared Drawer: a side panel on desktop and a full-screen sheet on a phone. It shows the summary rendered as markdown (react-markdown, raw HTML skipped, HTML comments removed), repository, PR link, path, a link to the run that wrote it, reward with its number of outcomes, use count, last used, date added, and recent uses (review of #N or a coding run, with links). Examples have no admin actions (remove or demote) yet, so the panel shows none.
    • Empty states: no examples yet, nothing in this toggle yet, and no matches (with Clear filters). A list skeleton shows while another repository loads, and the page's loading skeleton now includes the list.
    • If the gateway sends only text (an older one), the page builds the title, summary and reason from text itself, the same way the gateway does.
  • Drawer: a returnFocusTo option, so closing a panel opened from a row's own button puts focus back on that row.
  • LearningExemplar type: title, summary, reason, events, run_id, last_used_at, used_by.
  • Fixtures: realistic examples, a legacy one stored with GitHub markup, and enough rows to need "Show more".

Verification

  • npm run lint, npm run typecheck, npm run check:openapi, npm run build, and the full e2e suite on the static build (E2E_STATIC=1): 1144 passed.
  • New e2e tests in learning.spec.ts:
    • compact rows sorted by most used, 10 at a time, then Show more
    • toggle counts
    • no raw markup in the list or the panel, including for the legacy item
    • search, repository and kind filters, and clearing them
    • the panel: rendered markdown, PR, run and use links, Escape, focus back on the row
    • the panel's width (side panel at 1440, full screen at 390)
    • the loading skeleton
    • empty state
    • no sideways scroll
  • Screenshots at 1440 and 390 of the list and the panel, reviewed.

"Examples in use" printed every example as a card with its whole excerpt,
in two tall columns, raw markup included. It is now one list: a row per
example (clean title, why it is an example, kind/category/path tags, repo
and PR link, reward and use chips), To follow / To avoid toggles with
counts, search, repository and kind filters, most used first, ten at a
time. A row opens the example in a side panel (full screen on a phone)
with the rendered summary, PR and run links, reward, use count, when it
was last used and by which runs. Older gateways that send only `text`
are read the same way.
@nambok
nambok merged commit f102f98 into main Oct 27, 2026
5 checks passed
@nambok
nambok deleted the ui/examples-compact branch October 27, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant